<template>
  <div class="home">
  <k-form-design ref='kfd' />
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  data () {
    return {
      jsonData: {
        list: [
          {
            type: 'textarea',
            label: '文本框',
            icon: 'icon-edit',
            options: {
              width: '100%',
              minRows: 4,
              maxRows: 6,
              defaultValue: '',
              disabled: false,
              placeholder: '请输入'
            },
            model: 'textarea_1584772782841',
            key: 'textarea_1584772782841',
            rules: [
              {
                required: false,
                message: '必填项'
              }
            ]
          },
          {
            type: 'select',
            label: '下拉选择器',
            icon: 'icon-xiala',
            options: {
              width: '100%',
              multiple: false,
              disabled: false,
              clearable: false,
              placeholder: '请选择',
              options: [
                {
                  value: '1',
                  label: '下拉框1'
                },
                {
                  value: '2',
                  label: '下拉框2'
                }
              ],
              filterable: false
            },
            model: 'select_1584772783155',
            key: 'select_1584772783155',
            rules: [
              {
                required: false,
                message: '必填项'
              }
            ]
          },
          {
            type: 'input',
            label: '输入框',
            options: {
              type: 'text',
              width: '100%',
              defaultValue: '',
              placeholder: '请输入',
              disabled: false
            },
            model: 'input_1584772782393',
            key: 'input_1584772782393',
            rules: [
              {
                required: false,
                message: '必填项'
              }
            ]
          }
        ],
        config: {
          layout: 'horizontal',
          labelCol: {
            span: 4
          },
          wrapperCol: {
            span: 18
          },
          hideRequiredMark: false,
          customStyle: ''
        }
      }
    }
  },
  methods: {
    setData () {
      this.$refs.kfd.handleSetData(this.jsonData)
    }
  },
  mounted () {
    this.setData()
  }
}
</script>
